//
//  CPYFavoriteSongsModel.m
//  TTMusic
//
//  Created by chenpengyu on 16/4/7.
//  Copyright © 2016年 cpy. All rights reserved.
//

#import "CPYFavoriteSongsModel.h"

@implementation CPYFavoriteSongsModel

- (id)initWithDataSource:(NSDictionary *)dataSource {
    self = [super initWithDataSource:dataSource];
    if (self) {
        NSMutableArray *arr = [NSMutableArray arrayWithCapacity:0];
        for (NSDictionary *dic in self.mvList) {
            CPYFavoriteSongsMVModel *mvListModel = [[CPYFavoriteSongsMVModel alloc] initWithDataSource:dic];
            [arr addObject:mvListModel];
        }
        self.mvList = [NSArray arrayWithArray:arr];
        
        [arr removeAllObjects];
        
        for (NSDictionary *dic in self.urlList) {
            CPYFavoriteSongsURLListModel *urlModel = [[CPYFavoriteSongsURLListModel alloc] initWithDataSource:dic];
            [arr addObject:urlModel];
        }
        self.urlList = [NSArray arrayWithArray:arr];
    }
    return self;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    if ([key isEqualToString:@"picurl"]) {
        self.picUrl = value;
    }
    if ([key isEqualToString:@"singername"]) {
        self.singerName = value;
    }
    if ([key isEqualToString:@"playurl"]) {
        self.playUrl = value;
    }
}

@end
